<?php
$this->pageTitle = '所有商品类目';
$this->breadcrumbs=array(
	'所有商品类目',
);
?>
<div class="goods_header end_header">

	<h3>请选择商品类目</h3>

</div>
<div class="goods categories">
<?php
foreach($parentCate as $p){
	echo '<div class="title"><h3>'.$p->name.'</h3></div>';
	$i=1;
	foreach($p->cates as $c){
		$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
			'id'=>$c->cid,
			'options'=>array(
				'title'=>$c->name,
				'width'=>680,
				'height'=>350,
				'show' =>'bounce',
				'hide' => 'drop',
				'autoOpen'=>false,
				'resizable' => false,
				'modal' => true,
				'open' => "js:function (){
					jQuery('#".$c->cid."').html('正在加载，请稍候......');
					jQuery.post('".$this->createUrl('cate/ajaxcate')."',{'cid':".$c->cid."},function (data){
						jQuery('#".$c->cid."').html(data);
					});
				}",
			),
		));
		$this->endWidget('zii.widgets.jui.CJuiDialog');
		if ($i<10) $i = '0'.$i;
		echo CHtml::link($i.'. '.$c->name, array('cate/subcate','pid'=>$c->cid), array(
		   'onclick'=>'$("#'.$c->cid.'").dialog("open"); return false;',
		));

		$i++;
	}
	echo '<div class="clear"></div>';
}
?>
</div>